Building a library of queries